package com.hxf.dto;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.PolymorphismType;

/**
 * 会员实体类
 * 
 * @author tengyicheng
 * @version [1.0, 2013/09/23]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@Entity
@Table(name = "rk_user")
@org.hibernate.annotations.Entity(selectBeforeUpdate = true, dynamicInsert = true, dynamicUpdate = true, polymorphism = PolymorphismType.EXPLICIT)
public class UserDto extends BaseDto {
	private static final long serialVersionUID = 1L;

	private Integer userId; 				// 用户id
	private String userName; 				// 用户名
	private String realName; 				// 真实姓名
	private Integer userSex; 				// 性别
	private String userIdNo; 				// 身份证号
	private String userMobile;				// 固定电话
	private String userPhone; 				// 手机
	private String userAddress; 			// 地址
	private String userZipCode; 			// 邮编
	private String userEmail; 				// 邮箱
	private String userPwd; 				// 密码
	private Integer userType; 				// 用户类型  0.前台会员 1 后台人员 2 餐厅商家
	private Integer status; 				// 状态 0.有效  1.审核中 2.审核不通过 3.锁定 4.无效 
	private String createTime; 				// 创建时间 
	private String loginIp; 				// 登录IP
	private String loginTime; 				// 登录时间
	private Integer loginStatus; 			// 登录状态 0未登录 1 已登录
	private String userRelation;			// 联系人
	private String loginVersion;			// 登录版本号
	private Integer restaurantId;			// 餐厅ID
	private Integer restaurantUserId;		// 餐厅会员级别
	private Integer parentId;				// 会员上级
	private String parentUserId;            // 会员所处的级别,以 1#2#3# 的形式存储
	private String qq;						//QQ
	private Integer rank;					//级别 (普通会员 钻石会员)(普通餐厅，钻石餐厅)
	private Integer credit;					//信用值 

	/**
	 * 前台会员
	 */
	public static final Integer USER_TYPE_0 = 0;

	/**
	 * 餐厅商家
	 */
	public static final Integer USER_TYPE_1 = 1;

	/**
	 * 后台人员
	 */
	public static final Integer USER_TYPE_2 = 2;
	
	/**
	 * 有效
	 */
	public static final Integer USER_STATUS_0 = 0;

	/**
	 * 审核中
	 */
	public static final Integer USER_STATUS_1 = 1;
	
	 /**
	  * 审核不通过
	  */
	public static final Integer USER_STATUS_2 = 2;
	
	/**
	 * 锁定
	 */
	public static final Integer USER_STATUS_3 = 3;
	
	/**
	 * 无效
	 */
	public static final Integer USER_STATUS_4 = 4;
	
	/**
	 * 未登录
	 */
	public static final Integer LOGIN_STATUS_0 = 0;
	
	/**
	 * 已登录
	 */
	public static final Integer LOGIN_STATUS_1 = 1;
	
	//后台注册餐厅管理员， 默认为 1 ，为管理员
	public static final Integer REGISTER_ADMIN_1 = 1;
	
	public UserDto() {

	}

	public UserDto(Integer userId, String userName, String realName,
			Integer userSex, String userIdNo, String userMobile,
			String userPhone, String userAddress, String userZipCode,
			String userEmial, String userPwd, Integer userType, Integer status,
			String createTime , String userRelation, String loginIp,
			String loginTime, Integer loginStatus) {
		
		this.userId = userId;
		this.userName = userName;
		this.realName = realName;
		this.userSex = userSex;
		this.userIdNo = userIdNo;
		this.userMobile = userMobile;
		this.userPhone = userPhone;
		this.userAddress = userAddress;
		this.userZipCode = userZipCode;
		this.userEmail = userEmial;
		this.userPwd = userPwd;
		this.userType = userType;
		this.status = status;
		this.createTime = createTime;
		this.userRelation = userRelation;
		this.loginIp = loginIp;
		this.loginTime = loginTime;
		this.loginStatus = loginStatus;
	}

	public UserDto(Integer userId, String userName, String realName,
			Integer userSex, String userIdNo, String userMobile,
			String userPhone, String userAddress, String userZipCode,
			String userEmial, String userPwd, Integer userType, Integer status,
			String createTime, String userRelation) {
		this.userId = userId;
		this.userName = userName;
		this.realName = realName;
		this.userSex = userSex;
		this.userIdNo = userIdNo;
		this.userMobile = userMobile;
		this.userPhone = userPhone;
		this.userAddress = userAddress;
		this.userZipCode = userZipCode;
		this.userEmail = userEmial;
		this.userPwd = userPwd;
		this.userType = userType;
		this.status = status;
		this.createTime = createTime;
		this.userRelation = userRelation;
	}
	
	public UserDto(Integer userId, String userName, String userPwd, Integer userType, Integer status) {
		this.userId = userId;
		this.userName = userName;
		this.userPwd = userPwd;
		this.userType = userType;
		this.status = status;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "user_id")
	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "user_name")
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "user_sex")
	public Integer getUserSex() {
		return userSex;
	}

	public void setUserSex(Integer userSex) {
		this.userSex = userSex;
	}

	@Column(name = "user_id_no")
	public String getUserIdNo() {
		return userIdNo;
	}

	public void setUserIdNo(String userIdNo) {
		this.userIdNo = userIdNo;
	}

	@Column(name = "user_mobile")
	public String getUserMobile() {
		return userMobile;
	}

	public void setUserMobile(String userMobile) {
		this.userMobile = userMobile;
	}

	@Column(name = "user_phone")
	public String getUserPhone() {
		return userPhone;
	}

	public void setUserPhone(String userPhone) {
		this.userPhone = userPhone;
	}

	@Column(name = "user_address")
	public String getUserAddress() {
		return userAddress;
	}

	public void setUserAddress(String userAddress) {
		this.userAddress = userAddress;
	}

	@Column(name = "user_zip_code")
	public String getUserZipCode() {
		return userZipCode;
	}

	public void setUserZipCode(String userZipCode) {
		this.userZipCode = userZipCode;
	}

	@Column(name = "user_email")
	public String getUserEmail() {
		return userEmail;
	}

	public void setUserEmail(String userEmail) {
		this.userEmail = userEmail;
	}

	@Column(name = "user_pwd")
	public String getUserPwd() {
		return userPwd;
	}

	public void setUserPwd(String userPwd) {
		this.userPwd = userPwd;
	}

	@Column(name = "user_type")
	public Integer getUserType() {
		return userType;
	}

	public void setUserType(Integer userType) {
		this.userType = userType;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "real_name")
	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	@Column(name = "create_time")
	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	} 
	 

	@Column(name = "ip")
	public String getLoginIp() {
		return loginIp;
	}

	public void setLoginIp(String loginIp) {
		this.loginIp = loginIp;
	}

	@Column(name = "login_time")
	public String getLoginTime() {
		return loginTime;
	}

	public void setLoginTime(String loginTime) {
		this.loginTime = loginTime;
	}

	@Column(name = "login_status")
	public Integer getLoginStatus() {
		return loginStatus;
	}

	public void setLoginStatus(Integer loginStatus) {
		this.loginStatus = loginStatus;
	}

	@Column(name = "user_relation")
	public String getUserRelation() {
		return userRelation;
	}

	public void setUserRelation(String userRelation) {
		this.userRelation = userRelation;
	}

	@Column(name = "login_version")
	public String getLoginVersion() {
		return loginVersion;
	}

	public void setLoginVersion(String loginVersion) {
		this.loginVersion = loginVersion;
	}

	@Column(name = "restaurant_id")
	public Integer getRestaurantId() {
		return restaurantId;
	}

	public void setRestaurantId(Integer restaurantId) {
		this.restaurantId = restaurantId;
	}

	@Column(name = "restaurant_user_id")
	public Integer getRestaurantUserId() {
		return restaurantUserId;
	}

	public void setRestaurantUserId(Integer restaurantUserId) {
		this.restaurantUserId = restaurantUserId;
	}
	
	@Column(name="parent_id")
	public Integer getParentId() {
		return parentId;
	}
	
	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	@Column(name="parent_user_id")
	public String getParentUserId() {
		return parentUserId;
	}

	public void setParentUserId(String parentUserId) {
		this.parentUserId = parentUserId;
	}
	
	@Column(name="qq")
	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}
	
	@Column(name="rank")
	public Integer getRank() {
		return rank;
	}

	public void setRank(Integer rank) {
		this.rank = rank;
	}

	@Column(name="credit")
	public Integer getCredit() {
		return credit;
	}

	public void setCredit(Integer credit) {
		this.credit = credit;
	}

	@Override
	public String toString() {
		return "UserDto [userId=" + userId + ", userName=" + userName
				+ ", realName=" + realName + ", userSex=" + userSex
				+ ", userIdNo=" + userIdNo + ", userMobile=" + userMobile
				+ ", userPhone=" + userPhone + ", userAddress=" + userAddress
				+ ", userZipCode=" + userZipCode + ", userEmail=" + userEmail
				+ ", userPwd=" + userPwd + ", userType=" + userType
				+ ", status=" + status + ", createTime=" + createTime
				+ ", loginIp=" + loginIp + ", loginTime=" + loginTime
				+ ", loginStatus=" + loginStatus + ", userRelation="
				+ userRelation + ", loginVersion=" + loginVersion
				+ ", restaurantId=" + restaurantId + ", restaurantUserId="
				+ restaurantUserId + ", parentId=" + parentId
				+ ", parentUserId=" + parentUserId + "]";
	}
}
